package OBJ_Loader;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import klient.Klient;
import org.newdawn.slick.opengl.Texture;
import org.newdawn.slick.opengl.TextureLoader;

/**
 *  
 * @author Marcin & Bartek
 * 
 * @description Set of Models used by Objects
 * 
 */
public final class ModelBase {
    private ModelBase(){}
    private static Map<String,Model> base = new HashMap<>();
     public static Model get(String file){
         return get(file,0,0,0);
         
     }
    
    public static Model get(String file,float tx,float ty,float tz){
        if(base.containsKey(file)){
            Klient.log("Użyto "+file);
            return base.get(file);
        }else{
            Model m = Loader.load(new File(file),tx,ty,tz);
            base.put(file, m);
            Klient.log("Załadowano "+file);
            return m;
        }
    }    
}